package com.goodmr.passport.account;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 帐号类型
 *
 * @author <a href="mailto:bingdong13@msn.com">bigo</a>
 */
@Getter
@AllArgsConstructor
public enum AccountTypeEnum {

    MOBILE(1, "mobile", "手机"),
    EMAIL(2, "email", "邮箱"),
    QQ(3, "qq", "QQ"),
    WEIXIN(4, "weixin", "微信"),
    WEIBO(5, "weibo", "微博");

    private int value;

    private String name;

    private String desc;

    public static AccountTypeEnum get(int value) {

        for (AccountTypeEnum enumValue : AccountTypeEnum.values()) {
            if (enumValue.getValue() == value) {
                return enumValue;
            }
        }

        return null;
    }
}
